import  scrapy
import json
# 全球确诊
from Spiders.Citems import Citems
# 国内确诊
from Spiders.Citem import Citem


class Scro1(scrapy.Spider):
    name = 'scr01'
    start_urls=['https://arena.360.cn/api/service/data/ncov-live-3']

    def parse(self, response):
        # 全球
        citems=Citems()
        # 全国
        citem=Citem()
        data=json.loads(response.body_as_unicode())["data"]
        # total=data["total"]
        detail=data["detail"]
        timeline=data["timeline"]
        # a=[]
        # for j in timeline:
        #     a.append(j)
        # for i in detail:
        #     citem['city']=i['city']
        #     citem['diagnosed']=i['diagnosed']
        #     citem['cured']=i['cured']
        #     citem['died']=i['died']
        yield {"detail":detail,"timeline":timeline}



